package hupu.hnlp.hot_buffer.distbuffer.app;

import javax.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import hupu.hnlp.hot_buffer.distbuffer.service.DistBufferService;

@Component
public class Sync implements CommandLineRunner
{
    private final static Logger logger = LoggerFactory.getLogger(Sync.class);

    @Resource
    private DistBufferService dist_buffer_service;

    public void run(String... args) throws Exception
    {
        dist_buffer_service.initStorage();

//        dist_buffer_service.syncHotListDefault();
        dist_buffer_service.syncBlack(true);
        dist_buffer_service.syncContent(true);
        dist_buffer_service.syncVideo();

        dist_buffer_service.openSync();

        logger.info("sync finished");
    }

}
